import DataList from '../../utils/data-list'

Component({
  data: {
    list: DataList
  },
  methods: {
    /**
     * 接收pull-down-list组件的点击事件
     */
    chickHandle(e) {
      let { name, path = '' } = e.detail.item;
      name = name.toLowerCase();
      path = `/pages/${name}/${name}`;

      wx.navigateTo({
        url: path,
        fail: () => {
          wx.showToast({
            title: '该页面不存在！',
            icon: "error"
          });
        }
      })
    }
  }
});